home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
language
/
embedded
/
develop
/
libsrc11.arc
/
STASG.S
< prev
next >
Wrap
Text File
|
1989-04-27
|
1KB
|
61 lines
******************************************************************************
* stasg.s 3.1 11/12/84
*
* 68HC11 CROSS C COMPILER RUN-TIME LIBRARY
*
* (c) Copyright 1984, Motorola, Inc.
*
* FUNCTION NAME: .stasg
*
* ACTION: Copies structure value
*
* REGISTERS AND STACK:
*
* ON ENTRY: X: FP (frame pointer)
* D: Destination Pointer
* Y: Source Pointer
*
* STACK: Return Address (Pointer to in-line constant):
* fdb struct_size
* SP:
*
* ON EXIT: X: FP
* D: Destination Pointer
*
* STACK: Previous Contents
* SP:
*
******************************************************************************
psct
xdef .stasg
.stasg:
pshx save FP
pshb save destination address
psha
tsx make parameter addressable
ldx 4,%x return address
ldd 0,%x size of structure
pulx copy destination address
pshx ..into X (leave on stack)
psha save upper byte of size
tstb if lower byte of size
beq uchk ..is zero check upper byte
move: ldaa 0,%y copy byte from source
staa 0,%x ..to destination
iny increment pointers
inx
decb decrement lower byte count
bne move loop if not zero
uchk: pula lower byte zero so...
tsta ..check upper byte
beq done done if both are zero
deca upper byte count nonzero so...
psha ..decrement and...
bra move ..loop again
done: pula restore destination address
pulb
pulx restore FP
puly return address
jmp 2,%y return
end